// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported ControlsManager */
-const { Clutter, GObject, St } = imports.gi;
+const { Clutter, Gio, GObject, Meta, Shell, St } = imports.gi;
const Dash = imports.ui.dash;
+const Main = imports.ui.main;
const Overview = imports.ui.overview;
const ViewSelector = imports.ui.viewSelector;
+const WindowManager = imports.ui.windowManager;
var SIDE_CONTROLS_ANIMATION_TIME = Overview.ANIMATION_TIME;
this.dash.showAppsButton.connect('notify::checked',
this._onShowAppsButtonToggled.bind(this));
+ Main.wm.addKeybinding(
+ 'toggle-application-view',
+ new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }),
+ Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
+ Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
+ this._toggleAppsPage.bind(this));
+
this.connect('destroy', this._onDestroy.bind(this));
}
});
}
+ _toggleAppsPage() {
+ if (Main.overview.visible) {
+ const checked = this.dash.showAppsButton.checked;
+ this.dash.showAppsButton.checked = !checked;
+ } else {
+ Main.overview.show(ControlsState.APP_GRID);
+ }
+ }
+
_onDestroy() {
global.workspace_manager.disconnect(this._nWorkspacesNotifyId);
}
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported ViewSelector */
-const { Clutter, Gio, GObject, Meta, Shell, St } = imports.gi;
+const { Clutter, GObject, Meta, Shell, St } = imports.gi;
const Signals = imports.signals;
const AppDisplay = imports.ui.appDisplay;
}
});
- Main.wm.addKeybinding('toggle-application-view',
- new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
- Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
- Shell.ActionMode.NORMAL |
- Shell.ActionMode.OVERVIEW,
- this._toggleAppsPage.bind(this));
-
let side;
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
side = St.Side.RIGHT;
Main.overview.show();
}
- _toggleAppsPage() {
- this._showAppsButton.checked = !this._showAppsButton.checked;
- Main.overview.show();
- }
-
prepareToEnterOverview() {
this.show();
this.reset();